import Item from "@antv/g6-core/lib/item/item";
import {deepMix} from "@antv/util"

export default class Anchor extends Item{

    constructor(cfg) {
        const timestamp = new Date().getTime();
        const id = "anchor" + timestamp;
        super(deepMix(cfg, {
            type: 'anchor',
            model: {
                type: 'anchor',
                style: {
                    r: 1,
                    fill: '#FFF',
                    stroke: '#1890ff',
                    lineAppendWidth: 2,
                    cursor: 'crosshair',
                },
                id: id
            }
        }));
        this.enableCapture(true);
        this.toFront();
    }
}

